Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: aecf9c4a47
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
aecf9c4 to
40559e5
Compare
40559e5 to
18412cf
Compare
|
@harbournick @caio-pizzol - please review and merge. |
The centering math was using the full column width, ignoring paragraph indents (w:ind). This meant centered/right-aligned inline wpg groups in indented paragraphs were offset from where Word places them. Now propagates paragraphAttrs.indent through the drawing block attrs and subtracts it from the alignment box in layoutDrawingBlock.
Covers all ST_Jc values (left/justify/distribute produce no offset), non-shapeGroup drawingKind guard (image/vectorShape/chart), missing and empty wrap guards, oversized group scaling interaction, right alignment propagation, and left/justify non-propagation in pm-adapter.
Word distributes remaining space equally around single inline content, which visually centers a sole inline drawing. normalizeAlignment collapses 'distribute' to 'justify', so we check the raw justification value from resolvedParagraphProperties to distinguish it from 'both' (which only stretches inter-word spacing and does not center).
caio-pizzol
left a comment
There was a problem hiding this comment.
@artem-harbour fix works for SD-2469. i pushed three small commits on top:
- indent support — centering now accounts for paragraph indents, matching Word
- distribute alignment —
w:jc="distribute"now centers groups (regular justify stays left), matching Word - 7 more unit tests — guards for wrong drawing types, missing wrap, other alignment values, oversized groups
uploaded a 17-case test file to the corpus covering every alignment value + indents + RTL + edge cases. layout and visual tests pick it up automatically.
note: the Codex bot's suggestion to use block.wrap?.type would break the feature — normalizeWrap strips 'Inline' from that field. the current attrs.wrap approach is correct.
all 17 cases verified in dev app against Word.
Linear: SD-2469